package com.ihrm.system;


import com.ihrm.common.interceptor.JwtInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

@Configuration
public class SystemConfig extends WebMvcConfigurationSupport {
    @Autowired
    private JwtInterceptor jwtInterceptor;
    
    /**
     * 添加拦截器配置
     */
    @Override
    protected void addInterceptors(InterceptorRegistry registry){
        /**
         * 添加自定义拦截器
         */
        registry.addInterceptor(jwtInterceptor).
                /**
                 * 指定拦截器的url地址
                 */
                addPathPatterns("/**").
                /**
                 * 指定不拦截的url地址
                 */
                excludePathPatterns("/sys/login","/frame/register/**");
    }
}
